import com.edu.pojo.Announcement;
import com.edu.service.AnnouncementServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AnnounText {
    @Test
    public void text(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        AnnouncementServiceImpl announcementServiceImpl= (AnnouncementServiceImpl) context.getBean("announcementServiceImpl");
        for (Announcement announcement: announcementServiceImpl.queryAnnouncement()){
            System.out.println(announcement);
        }
    }
}
